<template>
  <div class="my-alert">
    <div class="my-alert-box">
      <span class="close" @click="send">×</span>
      <p class="text" :style="`color:${color}`">{{ message }}</p>
    </div>
  </div>
</template>
<script>
export default {
  props: ['message', 'color'],
  methods: {
    send() {
      this.$emit('close-alert', false)
    }
  }
}

</script>

<style scoped lang="less">
@import "../style/variable.less";

.my-alert {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  background-color: rgba(135, 98, 135, 0.25);
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.my-alert-box {
  font-family: logotext;
  background-color: #f1eff5de;
  width: 80%;
  height: 150px;
  border-radius: 10px;
  position: relative;

  .close {
    cursor: pointer;
    position: absolute;
    right: 5px;
    top: 5px;
    width: 30px;
    height: 30px;
    text-align: center;
    font-size: 28px;
    color: #fff;
  }

  .text {
    margin-top: 50px;
    text-align: center;
    width: 100%;
    padding: 10px;
    font-size: 18px;
    line-height: 1.75;
    color: #fff;
    font-weight: bolder;
  }
}
</style>